<!DOCTYPE html>
<html>
<head>
  <title>SVG.js</title>
  <script src="https://cdn.jsdelivr.net/npm/@svgdotjs/svg.js@3.0/dist/svg.min.js"></script>
</head>
<body>
  <div id="test"></div>
<script>
  // var draw = SVG().addTo('body').size(300, 300)
  var draw = SVG().addTo('#test').size('100%', '100%')
var rect = draw.rect(100, 100).attr({ fill: '#f06' })
</script>
</body>
</html>